﻿@model IEnumerable<OurWedding1.Models.Installment>

@using OurWedding1

<table id="installmentList" style="width: 100%">
    <thead>
        <tr>
            <th class="colLevel3">
                @Html.DisplayNameFor(m => m.Name)
            </th>
            <th>
                @Html.DisplayNameFor(m => m.Amount)
            </th>
            <th>
                @Html.DisplayNameFor(m => m.Deadline)
            </th>

            <th class="colLevel1">
                @Html.DisplayNameFor(m => m.Guest)
            </th>
            <th>
                @Html.DisplayNameFor(m => m.isDone)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr id="inst-@item.InstallmentId">
                <td class="colLevel3">
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Amount)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Deadline)
                </td>
                <td class="colLevel1">
                    @(item.Guest == null ? @Resources.None : item.Guest.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.isDone)
                </td>
                <td style="text-align:right">
                    @Html.ActionLink("Edit", "EditByExpense", new { id = item.InstallmentId }, new { @class = "editIconLink" })
                    @Html.ActionLink("Delete", "DeleteAjax",  new { id = item.InstallmentId }, new { @class = "deleteIconLink" })
                </td>
            </tr>
        }
    </tbody>
</table>
